import json


class MQTT_MSG_TYPE:
    MESSAGE = 0  # 普通消息
    ACTION = 1  # 动作
    PING = 2


class MQTTMsg:
    def __init__(self, content, type=MQTT_MSG_TYPE.MESSAGE):
        self.__type = type
        self.__content = content

    def __str__(self):
        return json.dumps({"type": self.__type, "content": self.__content})
